package com.xiaoxing.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.Date;
import java.util.List;

@SuppressWarnings("serial")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("sg_article")
@Accessors(chain = true) //支持map方法直接返回Article类型
public class Article  {

    @TableId(type = IdType.ASSIGN_ID, value = "id")
    private Long id;

    //标题
    private String title;

    //文章内容
    private String content;

    //文章类型:1 文章 2草稿
    //private String type;

    //文章摘要
    private String summary;

    //所属分类id
    private Long categoryId;

    @TableField(exist = false)
    private String categoryName;

    @TableField(exist = false)
    private List<String> tags;

    //缩略图
    private String thumbnail;

    //是否置顶（0否，1是）
    private String isTop;

    //状态（0已发布，1草稿）
    private String status;

    //评论数
    //private Integer commentCount;

    //访问量
    private Long viewCount;

    //是否允许评论 1是，0否
    private String isComment;

    //删除标志（0代表未删除，1代表已删除）
    private Integer delFlag;

    @TableField(fill = FieldFill.INSERT)
    private Long createBy;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateBy;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;


    public Article(Long valueOf, Long longValue) {
        this.id = id;
        this.viewCount = viewCount;
    }
}
